import { memberlist } from '../../api/api'

const state = {
  memberlist: []
}
const getters = {
  getmember (state) {
    return state.memberlist
  }
}
const mutations = {
  REQ_MEMBER (state, payload) {
    state.memberlist = payload
  }
}
const actions = {
  getMemberListAction ({ commit }) {
    memberlist().then((res) => {
      console.log(res)
      commit('REQ_MEMBER', res.list)
    })
  }
}

export default {
  state,
  getters,
  mutations,
  actions,
  // 开启命名空间
  namespaced: true

}
